import requests
from robot.api.deco import keyword

@keyword("Try Connect Web")
def try_connect_web(ip, port, auth, uri, header={}):
    req_url = 'https://{}:{}{}'.format(ip, port, uri)
    try:
        rsp = requests.get(
            url=req_url, headers=header, auth=auth, verify=False, timeout=(2, 30)
        )
        return rsp
    except requests.exceptions.RequestException as e:
        print(f"❌ web请求失败:{e}")
        return None